package com.sos.exception;

import lombok.Getter;

@Getter
public enum ErrorCode {
    // 用户相关错误
    USER_NOT_FOUND(1001, "用户不存在"),
    USER_ALREADY_EXIST(1002, "用户已存在"),
    USERNAME_ALREADY_EXIST(1006, "该用户名已存在"),
    PHONE_ALREADY_EXIST(1007, "该手机号码已被注册"),
    EMAIL_ALREADY_EXIST(1008, "该邮箱已被注册"),
    PASSWORD_ERROR(1003, "密码错误"),
    USER_DISABLED(1004, "用户已被禁用"),
    NOT_LOGIN(1005, "请先登录"),

    // 参数相关错误
    PARAM_ERROR(2001, "参数错误"),

    // 紧急联系人相关错误
    CONTACT_NOT_FOUND(4001, "紧急联系人不存在"),

    // SOS相关错误
    SOS_NOT_FOUND(5001, "SOS求助不存在"),
    SOS_ALREADY_TAKEN(5002, "SOS求助已被接单"),
    DUPLICATE_RESPONSE(5003, "不能重复响应"),
    UNAUTHORIZED_OPERATION(5004, "无权操作"),
    INVALID_RESCUE_STATUS_TRANSITION(5005, "无效的救援状态转换"),

    // 帮助者信息相关错误
    HELPER_INFO_NOT_FOUND(6001, "帮助者信息不存在"),
    HELPER_INFO_ALREADY_EXISTS(6002, "帮助者信息已存在"),

    // 验证码相关错误
    CODE_SEND_TOO_FREQUENTLY(7001, "验证码发送过于频繁"),
    INVALID_VERIFICATION_CODE(7002, "验证码无效"),

    // 健康档案相关错误
    HEALTH_PROFILE_NOT_FOUND(8001, "健康档案不存在"),

    // 文件上传相关错误
    FILE_UPLOAD_ERROR(9002, "文件上传失败"),

    // 系统错误
    SYSTEM_ERROR(9001, "系统内部错误");

    private final int code;
    private final String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

}